/*
 * @Author: your name
 * @Date: 2021-05-31 15:24:22
 * @LastEditTime: 2021-06-07 15:42:05
 * @LastEditors: Please set LastEditors
 * @Description: 商品相关api接口
 * @FilePath: \egg-demo\app\routes\goods.js
 */

'use strict';

module.exports = app => {
  const { router, controller } = app;
  // 创建goods
  router.post('/api/goods/create', controller.goods.create);
  router.post('/api/goodsgroups/create', controller.goodsGroups.create);

  // 编辑goods
  router.put('/api/goods/edit', controller.goods.edit);

  // 获取goods列表
  router.get('/api/goods/list', controller.goods.list);

  // 获取goods详情
  router.get('/api/goods/details', controller.goods.details);

  // 更改goods的状态
  router.put('/api/goods/changeStatus', controller.goods.editGoodsStatus );

  // 删除goods
  router.delete('/api/goods/delete/:uuid', controller.goods.remove);

  // 测试
  router.get('/api/goods/tt', controller.goods.tt)
}
